home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Sun Solutions 1997 April to September
/
Sun Solutions CD - APR '97 - SEP '97 (704-3778-12 Rev. H)(Sun Microsystems, Inc.)(1997).iso
/
products
/
bin
/
httpd
/
Solaris_2
/
AT-SunSolsearch.cgi
< prev
next >
Wrap
Text File
|
1997-02-27
|
4KB
|
125 lines
#!/tmp/httpd/.excite/perl
$root = "/tmp/httpd/.excite";
unshift(@INC, "$root/perllib");
require 'architext_query.pl';
require 'ctime.pl';
$aurl = "/.bin/Excite/";
$db = "SunSol";
$index = "/tmp/httpd/.products/.bin/Excite/collections/SunSol";
$hroot = "/tmp/httpd/.products";
$binary = "/tmp/httpd/.excite/architextSearch";
$urledit = 's|[\\\/]tmp[\\\/]httpd[\\\/]\.products[\\\/]|/|; ';
%form = &ArchitextQuery'readFormArgs;
&ArchitextQuery'directQuery($form{'search'} || '(no search)',
$form{'mode'} || 'concept', $db, $form{'source'} || 'local', $form{'backlink'} || '*', $form{'bltext'} || '*');
print "Content-type: text/html\n\n";
$myself = $aurl . '/AT-' . $db . 'search.cgi';
if ($form{'notifySearchPage'}) {
print qq(<html><head><title>EWS Querying</title></head>);
print qq(<body BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#FF0000" ALINK="#0000FF"><h1> <img src="${aurl}pictures/AT-search_banner.gif"> </h1><p>);
if (!open(QFORM, "$root/AT-query.html")) {
print "<h1>Couldn't find $root/AT-query.html</h1>";
print qq(<a href="$form{'notifyReturn'}">BACK</a>);
exit(0);
}
while (<QFORM>) {
s/CGI/$myself/;
s/BUTTON/$aurl\/pictures\/AT-search_button.gif/;
s/EXCITED/$aurl\/pictures\/AT-excited.gif/;
s/DOC/$aurl\/AT-queryhelp.html/;
s/QUERY/$form{'search'}/;
print "$_\n" unless ((/___SEPARATOR___/) || $skip_radio || (/___END___/));
$skip_radio = 0 if (/___END___/);
if (/___SEPARATOR___/) {
$skip_radio = 1;
print qq(<INPUT TYPE="hidden" NAME="notifyReturn" VALUE="$form{'notifyReturn'}">);
}
}
close(QFORM);
print qq(</body></html>);
exit(0);
}
## make NewSearch button point back to excite
if ($form{'notifyReturn'}) {
$form{'sp'} = 'sp';
if ($form{'notifyReturn'} eq '_back_') {
$ENV{'HTTP_REFERER'} = $myself . '?notifySearchPage=yes';
}
else {
$ENV{'HTTP_REFERER'} = $form{'notifyReturn'};
}
}
print "<html><head><title>Excite for Web Servers Search Results</title></head>\n";
#print "<body BGCOLOR=\"#FFFFFF\" TEXT=\"#000000\" LINK=\"#FF0000\" ALINK=\"#0000FF\">"; 'fred.
print "<body background=\"/SunSolutions/images/back3.gif\">";
#print "<h1><a href=\"http://www.excite.com/\"><img src=\"/Excite/pictures/AT-search_banner.gif\" BORDER=0></a></h1>\n"; 'fred.
print "<CENTER> <h1><a href=\"http://www.excite.com/\"><img src=\"/SunSolutions/images/cdban.gif\" BORDER=0></a></h1>\n";
print "<h1> Search Results </h1> </CENTER>";
$form{'root'} = $root;
$search = &ArchitextQuery'setSearchString(%form);
$searchtype = &ArchitextQuery'getSearchMode(%form);
## put necessary additional information into %form
$form{'aurl'} = $aurl;
$form{'db'} = $db;
$form{'index'} = $index;
$form{'hroot'} = $hroot;
$form{'binary'} = $binary;
$form{'urledit'} = $urledit;
$form{'searchpage'} = $ENV{'HTTP_REFERER'} if ($form{'sp'});
$form{'docs'} = '1' unless $form{'docs'};
$form{'psearch'} = $form{'psearch'} || $form{'search'};
$form{'search'} = $search;
$errstr = 'success';
## This call checks to make sure that an index has been built for
## this collection. Also checks if we should use new query syntax
$form{'newquery'} = &ArchitextQuery'checkForIndex(%form);
if ($searchtype eq 'confidence') {
## Perform the query. This function doesn't print anything.
##Later commands will display the results.
($errstr, @query_results) = &ArchitextQuery'MakeQuery(%form);
$docs = &ArchitextQuery'PrepareGather(*query_results);
$form{'docs'} = $docs;
## &ArchitextQuery'showSearchMode($searchtype, %form)
## unless (($errstr eq 'summary') || ($errstr eq 'dump')); 'fred.
&ArchitextQuery'showSearchString(%form)
unless (($errstr eq 'summary') || ($errstr eq 'dump'));
&ArchitextQuery'HtmlList(*query_results, %form) if ($errstr eq 'success');
} else {
## subject group query
## &ArchitextQuery'showSearchMode($searchtype, %form); 'fred.
&ArchitextQuery'showSearchString(%form, 'gather', 'gather');
$errstr = &ArchitextQuery'MakeGather(%form);
}
if ($errstr eq 'summary') {
&ArchitextQuery'SummaryOutput($form{'stitle'} || '*',
$form{'surl'} || '*',
*query_results);
} elsif ($errstr eq 'dump') {
&ArchitextQuery'DocumentOutput(*query_results);
} else {
print &ArchitextQuery'queryError($errstr)
unless ($errstr eq 'success');
}
&ArchitextQuery'footer($aurl) if ($errstr eq 'success');
print "</body></html>\n";